let url="http://newshopapi.0melon0.cn/api/f_user/Qrcode"
let names=document.querySelector(".box>.he");
let head=document.querySelector(".head");
let imgs=document.querySelector(".imgs");
let btn=document.querySelector(".btn");
ajax(url,{
    "token": localStorage.getItem("token"),
    "id":localStorage.getItem("id")
}, "GET").then(res => {
    let times=localStorage.getItem("times");
    //年月日
    let year=times.split("-")[0];
    let month=times.split("-")[1];
    let day=times.split("-")[2];
    //时分秒
    let h=times.split("-")[3];
    console.log(times.split("-"));
    names.innerHTML=`<p>${localStorage.getItem("name")}:</p>`;
    imgs.innerHTML=`<img src="${res.data.data}" alt="">`;
    head.innerHTML=`<p>欢迎您在${month}月${day}日${h}参观${year}广州国际
    花卉艺术展暨中国插花花艺展。</p>`;
    btn.addEventListener("click",()=>{
        btn.a.href=`${res.data.data}`;
    })
}).catch(err => {
    console.log(err);
});